struct Size {
mut:
	width  int
	height int
}

fn (s &Size) area() int {
	return s.width * s.height
}

struct Button {
	// with embedding, Button will automatically have get all the fields and method from Size
	// unlike inheritance, you cannot type cast between structs and embedded structs
	// use an explicit reference to access embedded structs directly
	// embedded structs are similar to mixins in OOP, NOT base classes
	// name and method conflicts: use explicit references
	Size
	title string
}

fn main() {
	mut button := Button{
		title: 'Click me'
		height: 2
	}

	button.width = 3
	assert button.area() == 6
	assert button.Size.area() == 6
	println(button)
}
